var apppack = context.getPackageName();
var AppName = getAppName(apppack);
if (!isBarrier(apppack)) {
    dialogs.build({
            title: "提示",
            content: "检测到您的无障碍服务未开起，部分自动操作需要开启才能运行，是否前往开启",
            neutral: "取消",
            negative: "立即开启",
            cancelable: false
        })
        .on("neutral", () => {
            //toast("不开启将无法运行");
        })
        .on("negative", () => {
            toastLog("请选择，" + AppName + "  打开无障碍辅助功能")
            let intent = new Intent();
            intent.setAction("android.settings.ACCESSIBILITY_SETTINGS");
            app.startActivity(intent);
        })
        .show();
}

function isBarrier(app) {
    if (android.provider.Settings.Secure.getString(context.getContentResolver(), "enabled_accessibility_services").indexOf(app) > -1) {
        return true;
    } else {
        return false;
    };
};